package com.job.ming.Zuoye0707.oop0707;

/**
 * @author Yangmingyu
 * @version 1.0
 * @since 2022-07-08 16:02:57
 */
public class Myhelper {
    public String name = "何";
    public int age = 20;
    public String zhuanye = "计算机";


    public void show() {
        Myhelper yi = new Myhelper();
        System.out.println(yi.name);
        System.out.println(yi.age);
        System.out.println(yi.zhuanye);
    }

    public static void fanhui(double[] r) {
        for (int t = 0; t < r.length - 1; t++) {
            for (int i = t + 1; i < r.length; i++) {
                if (r[t] > r[i]) {
                    double temp = r[i];
                    r[i] = r[t];
                    r[t] = temp;
                }
            }
        }
        double sum = 0;
        double ave = 0;
        for (int t = 0; t < r.length - 1; t++) {
            sum = sum + r[t];
        }
        ave = 1.0 * sum / (r.length);
        if (r[r.length / 2] < ave) {
            System.out.println(ave);
        } else {
            System.out.println(r[r.length / 2]);
        }
    }
}